package cn.petplatform.petback.service.pettypes.impl;

import cn.petplatform.dto.ResponseDto;
import cn.petplatform.petback.mapper.PetTypeMapper;
import cn.petplatform.petback.pojo.PetType;
import cn.petplatform.petback.pojo.PetTypeExample;
import cn.petplatform.petback.service.pettypes.PetTypesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author LNL
 * @date 2021/5/18 11:56
 */
@Service("petTypesService")
@Transactional
public class PetTypesServiceImpl implements PetTypesService {

    @Autowired
    private PetTypeMapper petTypeMapper;

    @Override
    public ResponseDto getPetTypes() {
        ResponseDto responseDto = null;
        List<PetType> petTypes = petTypeMapper.selectByExample(new PetTypeExample());
        responseDto = new ResponseDto("1000","宠物类型",petTypes);
        return responseDto;
    }
}
